#!/bin/bash

yum -y install nfs-utils rpcbind system-config-firewall-tui

mkdir $1 
chmod -R 777 $1

chkconfig nfs on
chkconfig nfslock on
chkconfig rpcbind on

echo "$1 10.0.0.0/255.0.0.0(rw,sync,no_root_squash)" >> /etc/exports

echo "mountd: 10.0.0.0/255.0.0.0" >> /etc/hosts.allow
echo "portmap:ALL" >> /etc/hosts.deny
echo "lockd:ALL" >> /etc/hosts.deny
echo "mountd:ALL" >> /etc/hosts.deny
echo "rquotad:ALL" >> /etc/hosts.deny
echo "statd:ALL" >> /etc/hosts.deny

service rpcbind restart
service nfs restart
service nfslock restart
